package demo3_recursive;

public class TestFebonacci {
    public static void main(String[] args) {
        //斐波那契列数列：1 1 2 3 5 8 13
        int i = febonacii(6);
        System.out.println(i);
    }
    //打印n项斐波那契数列
    public  static int febonacii(int i){
        if (i == 1 || i == 2){
            return 1;
        }else {
            return  febonacii(i-1)+febonacii(i-2);
        }
    }
}
